next up previous
Next: 3.2.8 Versioning and GLX Up: 3.2 Functions Previous: 3.2.6 Double Buffering

3.2.7 Access to X Fonts

A shortcut for using X fonts is provided by the command

void glXUseXFont ( Font font , int first , int count , int list _base ) ;

count display lists are defined starting at list _base, each list consisting of a single call on glBitmap. The definition of bitmap list _base + i is taken from the glyph first + i of font. If a glyph is not defined, then an empty display list is constructed for it. The width, height, xorig, and yorig of the constructed bitmap are computed from the font metrics as rbearing-lbearing, ascent+descent, -lbearing, and descent-1 respectively. xmove is taken from the width metric and ymove is set to zero.

Note that in the direct rendering case, this requires that the bitmaps be copied to the client's address space.

glXUseXFont performs an implicit glFlush().

glXUseXFont is ignored if there is no current GLX rendering context. BadFont is generated if font is not a valid X font id. GLXBadContextState is generated if the current GLX rendering context is in display list construction mode. GLXBadCurrentWindow is generated if the drawable associated with the calling thread's current context is a window and is no longer valid.



Mark Segal
Wed Jan 11 18:38:15 PST 1995